using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class 打开ui : MonoBehaviour
{
    public GameObject ui;
    public bool isopen = true;
    // Start is called before the first frame update
    void Start()
    {
        Button button = GetComponent<Button>();
        button.onClick.AddListener(OpenUI);
    }

    void OpenUI()
    {
        if (isopen != true)
        {
            ui.SetActive(false);
        }
        else
        {
            ui.SetActive(true);
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
